<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <div>
        <input type="checkbox" v-model:checked="flag" />全选
        <div v-for="i in fruit">
          <input type="checkbox" v-bind:checked="flag" />{{ i.name }}
        </div>
      </div>
    </div>
    <script src="./vue.js"></script>
    <script>
      let app = new Vue({
        el: "#app",
        data: {
          fruit: [
            { name: "苹果" },
            { name: "梨子" },
            { name: "香蕉" },
            { name: "榴莲" },
          ],
          flag: false,
        },
      });
    </script>
  </body>
</html>
